package cn.project.lemontree.service.impl;

import cn.project.lemontree.bean.Parent;
import cn.project.lemontree.dao.ParentDao;
import cn.project.lemontree.service.ParentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class ParentServiceImpl extends ServiceImpl<ParentDao, Parent> implements ParentService {
    @Resource
    private  ParentDao parentDao;
    @Override
    public List<Parent> listpage(int page, int size, String parentName,String telephone) {
        return parentDao.listPage((page-1)*size,size,parentName,telephone);
    }

    @Override
    public int count(String parentName,String telephone) {
        return parentDao.count(parentName,telephone);
    }

    @Override
    public boolean save(Parent parent) {
        return parentDao.save(parent) > 0;
    }

    @Override
    public Parent login(String telephone){
        return parentDao.login(telephone);
    }

    @Override
    public boolean update(Parent parent) {
        return parentDao.update(parent)>0;
    }

    @Override
    public List<Parent> findParentByid(Integer childId){
        return parentDao.findParentByid(childId);
    }

    @Override
    public Parent findBytp(String telephone) {
        return parentDao.findBytp(telephone);
    }

    @Override
    public List<Parent> getByClassId(Integer classId){
        return parentDao.getByClassId(classId);
    }
}
